<?php require __DIR__.'/header.html';?>

<div id="content">
	<header class="site-header">
		<canvas id="d" height="0" style="position: absolute; left: 0px; top: 0px;"></canvas>
		<nav class="navbar navbar-static-top main-navbar" id="top">
			<div class="container">
				<div class="navbar-header">
					<a href="/" class="navbar-brand brand-dev-api text-hide">&nbsp;</a>
				</div>
			</div>
		</nav>
		<div class="container jumbotron">
			<div class="row">
				<div class="col-xs-12">
					<h1>
						<?php echo $data['info']['l_title'];?>
					</h1>
					<p>
						<?php echo $data['info']['l_desc'];?>
					</p>
				</div>
			</div>
		</div>
	</header>
	<div class="package-info well well-md text-center" style="margin-bottom: 0px; border-radius: 0px;">
		<div class="container">
			<ul class="list-inline">
				<li><a href="javascript:void(0)" data-toggle="tab">API文档</a></li>
			</ul>
		</div>
	</div>
	<main class="container tab-content" id="myTabContent">
		<article class="markdown-body tab-pane fade in active" id="api">
			<div class="api-sub-content">
				<div class="simpleline"><strong>接口地址：</strong><span class="url">
						<?php echo $data['info']['l_address'];?>
					</span></div>
				<div class="simpleline"><strong>返回格式：</strong><span class="url">
						<?php echo $data['info']['l_format'];?>
					</span></div>
				<div class="simpleline"><strong>请求方式：</strong><span class="url">
						<?php echo $data['info']['l_mode'];?>
					</span></div>
				<div class="simpleline"><strong>请求示例：</strong><span class="url">
						<?php echo $data['info']['l_ask'];?>
					</span>
				</div>
				<div class="simpleTable">
					<p class="request">请求参数说明：</p>
					<table class="api-table" border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr class="title">
								<th width="20"></th>
								<th width="100">名称</th>
								<th width="60">必填</th>
								<th width="80">类型</th>
								<th>说明</th>
							</tr>
							<?php if(!empty($data['val'])):
													foreach ($data['val'] as $k => $v) : 
													if($v['p_api_type']==0):?>
							<tr>
								<td></td>
								<td>
									<?php echo $v['p_name'];?>
								</td>
								<td>
									<?php echo $v['p_crux'];?>
								</td>
								<td>
									<?php echo $v['p_type'];?>
								</td>
								<td>
									<?php echo $v['p_desc'];?>
								</td>
							</tr>
							<?php endif;
													endforeach;
													endif; ?>
					</table>
				</div>
				<div class="simpleTable">
					<p class="response">返回参数说明：</p>
					<table class="api-table" border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr class="title">
								<th width="20"></th>
								<th width="100">名称</th>
								<th width="80">类型</th>
								<th>说明</th>
							</tr>

							<?php if(!empty($data['val'])):
													foreach ($data['val'] as $k => $v):
													if($v['p_api_type']==1):?>
							<tr>
								<td></td>
								<td>
									<?php echo $v['p_name'];?>
								</td>
								<td>
									<?php echo $v['p_type'];?>
								</td>
								<td>
									<?php echo $v['p_desc'];?>
								</td>
							</tr>
							<?php endif;
													endforeach;
													endif; ?>
						</tbody>
					</table>
				</div>

				<div class="simpleTable">
					<p class="response">返回参数说明：</p>
					<pre class="layui-code"><?php echo $data['info']['l_example'];?></pre>
				</div>
			</div>
		</article>
	</main>
	<script src="/assets/tom/js/jquery.min.js"></script>
	<script src="/assets/tom/js/bootstrap.min.js"></script>
	<script src="/assets/tom/js/catebg.js"></script>
</div>

<?php require __DIR__.'/footer.html';?>